package com.tianqu.tms.dao;

import java.sql.SQLException;
import java.util.List;

import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.dto.TmsDetectInfoDto;

public interface TmsDetectInfoDao {
	
	/**
	 * 根据车辆状态查询出车辆来源和车辆条数
	 * @param status
	 * @return
	 * @throws TmsDaoException
	 */
	public List<TmsDetectInfoDto> getAllocateDispatchInfo(int status) throws TmsDaoException;
	/**
	 * 根据车辆ID获取车辆信息
	 * @param carSerial
	 * @return
	 * @throws TmsDaoException
	 */
	public TmsDetectInfoDto getAllocateCarInfoById(String carSerial,int status) throws TmsDaoException;
	
	/**
	 * 根据车辆来源查询车辆信息列表
	 * @param source
	 * @param status
	 * @return
	 * @throws TmsDaoException
	 * @throws SQLException 
	 */
	
	public List<TmsDetectInfoDto> getAllocateDispatchInfoBySource(String source,int status) throws TmsDaoException;
	
	/**
	 * 插入车辆信息
	 * @param dto
	 * @throws TmsDaoException
	 */
	public void carImportcsv(TmsDetectInfoDto dto) throws TmsDaoException;
	

	//查询汽车广场及tq车辆数量
	public int getcarNum(int source,int carType)  throws TmsDaoException;
	
	/**
	 * 删除车辆信息
	 * @param carSerial
	 * @throws TmsDaoException
	 */
	public void delCarinfo(String carSerial) throws TmsDaoException;

	/**
	 * 根据车辆ID集合查询车辆信息
	 * @throws TmsDaoException 
	 */
	public List<TmsDetectInfoDto> findAllocateCarInfoBySerialCollection(String serialCollection) throws TmsDaoException;
	
	/**
	 * 根据车辆ID集合和车辆检测录入模式批量更新数据库
	 * @throws TmsDaoException 
	 */
	public void updateCarInfoBySerialCollectionAndAddMode(String serialCollection,String addMode,int userId) throws TmsDaoException;
	/**
	 * 待分配根据车辆ID批量删除车辆信息
	 * @throws TmsDaoException 
	 */
	public void deleteCarInfoBySerialCollection(String serialCollection) throws TmsDaoException;
	/**
	 * 根据车辆状态查询出所有待检测车辆信息
	 * @param source
	 * @return
	 * @throws TmsDaoException 
	 */
	public List<TmsDetectInfoDto> findAllWDIpadCarInfoByStatus(int status) throws TmsDaoException;
	
	/**
	 * 转录入模式的时候，如果有检测信息将基本信息表中所有检测信息置空
	 * @throws TmsDaoException 
	 * 
	 * 
	 */
	public void updateCarInfoToZeroBySerial(String carSerial) throws TmsDaoException;
	/**
	 * updateCarDetectInfo
	 * 在基本信息表中更新检测信息
	 * @throws TmsDaoException 
	 */
	public void updateCarDetectInfo(TmsDetectInfoDto dto) throws TmsDaoException;
	
	/**
	 * 更新车辆状态
	 * @param carSerial
	 * @param status
	 * @throws TmsDaoException
	 */
	 public void updateCarStatus(String carSerial,int status)throws TmsDaoException;
	 /**
	  * 
	  * 根据车辆ID还原车辆基本信息，根据状态更新车辆状态
	 * @throws TmsDaoException 
	  */
	 public void resetCarInfoByIdAndStatus(String carSerial,int status,int userId) throws TmsDaoException;
	 /**
	  * 车辆搜索 根据条件搜索车辆信息
	 * @throws TmsDaoException 
	  * 
	  */
	 public List<TmsDetectInfoDto> findCarInfoByCon(TmsDetectInfoDto dto) throws TmsDaoException;
	 
	 public List<TmsDetectInfoDto> getWDPersonDispatchInfoBySource(int source,int status) throws TmsDaoException;
	 
	 /**
	  * 根据车辆ID和状态查询是否存在车辆检测信息
	  * 
	  * @return
	  * @throws TmsDaoException
	  */
	 public TmsDetectInfoDto getDetectinfoBySerialAndStatus(String serial) throws TmsDaoException;
	 
		public TmsDetectInfoDto getDetectScore(String serial) throws TmsDaoException;
}
